package demo2;

public class TestAnimal {

    public static void eat(Animal a){
        a.eat();
    }


    public static void main(String[] args) {
        Cat cat = new Cat("元宝",2);
        Dog dog = new Dog("小黑",1);

        eat(cat);
        eat(dog);
    }
}